<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <title>创建投票</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=4a6c1b54">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <script src="https://file.ggxqce.com/web/vue.min.js"></script>
    <link href="/dist/plugins/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet"/>
    <style>
        [v-cloak] {
            display: none;
        }

        input:focus {
            　　font-size: 16px !important;
        }

        * {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            outline: none;
        }

        body {
            background: rgb(243, 244, 248);
        }

        .btn-blue {
            border: none;
            background: #228bee;
            color: #fff;
            height: 30px;
            width: 14%;
            border-radius: 3px;
        }

        .visitingBox {
            background: #fff;

        }

        .item {
            height: 45px;
            line-height: 45px;
            padding: 0 10px;
            font-size: 14px;
            border-bottom: 1px solid #ddd;
            position: relative;
        }

        .item .title {
            float: left;
        }

        .item .time {
            float: right;
            color: #333;

        }

        .btn-blue.focus, .btn-blue:focus, .btn-blue:hover {
            color: #fff;
            text-decoration: none;
        }

        .lineTwo span {
            max-height: 55px;
            line-height: 16px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 3;
            text-align: left;
            padding: 5px;

        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .imgBox {
            margin-left: 20px;
        }

        .imgBox .title {
            padding-left: 5px;
            height: 45px;
            line-height: 45px;
            position: relative;
            font-size: 14px;
        }

        .imgBox .title i {
            position: absolute;
            left: -10px;
            top: 2px;
            color: red;
            font-size: 16px;
        }

        .imgBox img {
            width: 80px;
            height: 80px;
            margin-bottom: 20px;
        }

        .imgBox .desc {
            color: #aaa;
        }

        .btnBox {
            width: 120px;
            height: 120px;
            margin: 0 auto;
            margin-top: 60px;
            position: relative;
        }

        .btnBj {
            background: #cde2f7;
            border-radius: 50%;
            width: 100%;
            height: 100%;
            position: relative;
            animation: mymove 3s infinite;
            -webkit-animation: mymove 3s infinite; /*Safari and Chrome*/
            animation-direction: alternate; /*轮流反向播放动画。*/
            animation-timing-function: linear; /*动画的速度曲线*/
            /* Safari 和 Chrome */
            -webkit-animation: mymove 3s infinite;
            -webkit-animation-direction: alternate; /*轮流反向播放动画。*/
        }


        @keyframes mymove {
            0% {
                transform: scale(1); /*开始为原始大小*/
            }

            50% {
                transform: scale(0.8);
            }

        }

        @-webkit-keyframes mymove /*Safari and Chrome*/
        {
            0% {
                transform: scale(1); /*开始为原始大小*/
            }

            50% {
                transform: scale(0.8);
            }
        }

        .tijiaoBtn {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 50px;
            line-height: 50px;
            background: #228bee;
            color: #fff;
            text-align: center;
            font-weight: bold;
            font-size: 16px;
        }

        .item input {
            border: none;
            width: 100%;
            float: left;
            height: 45px;
            line-height: 45px;
            background: none;
            text-align: center;
        }

        .voteTitle {
            font-size: 20px;
            font-weight: bold;
        }

        .addIcon {
            background: #228bee;
            width: 50px;
            height: 30px;
            margin: 0 auto;
            float: left;
            border-radius: 5px;
            background-size: cover;
            /* margin-top: 7px; */
            color: #fff;
            font-style: normal;
            text-align: center;
            line-height: 30px;
            font-size: 14px;
        }

        /*.removeIcon {*/
        /*background: url("/dist/img/jianIcon.png");*/
        /*background-size: cover;*/
        /*width: 20px;*/
        /*height: 20px;*/
        /*position: absolute;*/
        /*margin-right: 5px;*/
        /*margin-top: 12px;*/
        /*}*/
        .removeIcon {
            background-color: rgb(230, 67, 64);
            width: 50px;
            height: 30px;
            border-radius: 5px;
            background-size: cover;
            margin: 0 auto;
            float: left;

            color: #fff;
            font-style: normal;
            text-align: center;
            line-height: 30px;
            font-size: 14px;
        }

        .timeBox {
            height: 45px;
            line-height: 45px;
            font-size: 14px;
            border-bottom: 1px solid #ddd;
            position: relative;
            background: #fff;
            margin: 0;
            margin-top: 10px;
            padding: 0 15px;
        }

        input::-webkit-input-placeholder {
            color: #aaa;
        }

        .dian {
            position: absolute;
            width: 10px;
            height: 10px;
            background: #228bee;
            border-radius: 50%;
            top: 18px;
            left: 10px;
        }

        .yz {
            position: absolute;
            right: 60px;
            top: 0px;
            font-size: 12px;
            color: red;
            display: none;
        }

        .disaItem {
            background: rgb(235, 235, 228);
        }

        .treeBox {
            height: 100vh;
            width: 100%;
            position: fixed;
            top: 0;
            left: 0;
            z-index: 99999999999;
            background: #fff;
            text-align: center;
        }

        /*ztree*/
        .ztree li {

            line-height: 24px;
        }

        .ztree li span.button.ico_open {
            vertical-align: sub;
            margin-right: 6px;
        }

        .ztree li span.button.ico_close {
            vertical-align: sub;
            margin-right: 6px;
        }

        .ztree li span.button.chk {
            margin-right: 6px;
            margin-left: 6px;

        }

        .ztree li span.button.root_open {
            transform: scale(1.4, 1.4);
            margin-top: -1px;
        }

        .ztree li span.button.root_close {
            transform: scale(1.4, 1.4);
            margin-top: -1px;
        }

        .ztree li span.button.roots_open {
            transform: scale(1.4, 1.4);
            margin-top: -1px;
        }

        .ztree li span.button.roots_close {
            transform: scale(1.4, 1.4);
            margin-top: -1px;
        }

        .ztree li span.button.center_open {
            transform: scale(1.4, 1.4);
            margin-top: -1px;
        }

        .ztree li span.button.center_close {
            transform: scale(1.4, 1.4);
            margin-top: -1px;
        }

        .ztree li span.button.bottom_open {
            transform: scale(1.4, 1.4);
            margin-top: -1px;
        }

        .ztree li span.button.bottom_close {
            transform: scale(1.4, 1.4);
            margin-top: -1px;
        }

        .ztree li span.button.noline_open {
            transform: scale(1.4, 1.4);
            margin-top: -1px;
        }

        .ztree li span.button.noline_close {
            transform: scale(1.4, 1.4);
            margin-top: -1px;
        }

        .ztree * {
            font-size: 14px;
        }

        .scfj {
            background: url(/dist/img/fjT1.png) no-repeat 5px center;
            display: block;
            padding: 0 4px;
            height: 45px;
            line-height: 45px;
            padding-left: 15px;
            margin: 0 auto;
            width: 100px;
            border-radius: 4px;
            float: left;
            color: #74adf2;
            text-align: left;
        }

        .fjBox {
            width: 100%;
            float: left;
            height: 100%;
            background-color: #E3EAF4;
        }

        .fj-tanzhongStyle {
            margin-top: 3px;
            height: 40px;
        }

        .fj-tanzhongStyle .img {
            transform: scale(1, 1);
            margin: 4px 0 0 4px;
        }

        .fj-tanzhongStyle .name {
            line-height: 16px;
            text-align: left;
            height: 16px;
            font-size: 14px;
            top: 4px;
            width: 100%;
            padding-right: 50px;

        }

        .fj-tanzhongStyle .del {
            top: 15px;
            /* bottom: 0; */
            line-height: 30px;
            left: 42px;
        }

        .table > thead > tr > th {
            background: rgb(248, 248, 248);
            height: 45px;
        }


        .time_span1 {
            margin-left: 10px;
        }

        .timeBox input {
            border: 0px;
            outline: none;
            cursor: pointer;
            /* width: 45%; */
            /* margin-left: 22px; */
            text-align: right;
            color: rgb(42, 140, 236);
        }

        .time-controller {
            position: fixed;
            left: 0;
            top: 0;
            z-index: 100;
            width: 100%;
            height: 100%;
            overflow: hidden;
            text-align: center;
            font-size: 14px;
            background-color: rgba(37, 38, 45, .4);
        }

        .time-controller .time-controller-all {
            position: absolute;
            z-index: 600;
            bottom: 0;
            width: 100%;
            height: 273px;
            background: #fff;
        }

        .time-controller .time-controller-all .time-controller-choice {
            position: relative;
            height: 60px;
            color: #999;
        }

        .time-controller .time-controller-all .time-controller-content {
            position: relative;
            top: 20px;
            height: 173px;
        }

        .border-bottom,
        .border-top {
            position: relative;
        }

        .border-bottom:after,
        .border-bottom:before,
        .border-top:after,
        .border-top:before {
            content: "";
            display: block;
            position: absolute;
            -webkit-transform-origin: 0 0;
            transform-origin: 0 0;
        }

        .border-bottom:after {
            border-bottom: 1px solid #ebebeb;
            left: 0;
            bottom: 0;
            width: 100%;
            -webkit-transform-origin: 0 bottom;
            transform-origin: 0 bottom;
        }

        .time-controller .time-controller-all .time-controller-choice .cancel {
            left: 0;
        }

        .time-controller .time-controller-all .time-controller-choice .sure {
            right: 0;
            color: #fc9153;
        }

        .time-controller .time-controller-all .time-controller-choice .time-controller-top {
            margin: 0;
            line-height: 60px;
            font-weight: 400;
            text-align: center;
            font-size: 18px;
            color: #333;
        }

        .time-controller .time-controller-all .time-controller-choice .cancel,
        .time-controller .time-controller-all .time-controller-choice .sure {
            position: absolute;
            top: 6px;
            padding: 16px;
            font-size: 14px;
        }

        .time-controller .time-controller-all .time-controller-content .time-package-top {
            position: absolute;
            top: 0;
            background: -webkit-linear-gradient(bottom, hsla(0, 0%, 100%, .4), hsla(0, 0%, 100%, .8));
            background: linear-gradient(bottom, hsla(0, 0%, 100%, .4), hsla(0, 0%, 100%, .8));
        }

        .time-controller .time-controller-all .time-controller-content .time-package-bottom {
            position: absolute;
            bottom: 1px;
            background: -webkit-linear-gradient(top, hsla(0, 0%, 100%, .4), hsla(0, 0%, 100%, .8));
            background: linear-gradient(top, hsla(0, 0%, 100%, .4), hsla(0, 0%, 100%, .8));
        }

        .time-controller .time-controller-all .time-controller-content .time-package-bottom,
        .time-controller .time-controller-all .time-controller-content .time-package-top {
            z-index: 10;
            width: 100%;
            height: 68px;
            pointer-events: none;
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
        }

        .border-top:before {
            border-top: 1px solid #ebebeb;
            left: 0;
            top: 0;
            width: 100%;
        }

        .time-controller .time-controller-all .time-package {
            display: -webkit-box;
            display: flex;
            padding: 0 16px;
        }

        .time-controller .time-controller-all .time-package .time {
            flex: 1;
            flex-basis: 1 e-9px;
            width: 1%;
            height: 173px;
            overflow: hidden;
            font-size: 20px;
        }

        .time-controller .time-controller-all .time-package .time:first-child {
            flex: 1.8;
        }

        .time-controller .time-controller-all .time-package .time .time-list {
            padding: 0;
            margin-top: 68px;
            line-height: 36px;
            list-style: none;
            transition-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
        }

        .time-controller .time-controller-all .time-package .time .diff {
            transition-duration: 150ms;
        }

        .time-controller .time-controller-all .time-package .time .time-list .time-list-item {
            transition-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
        }

        .listBox {
            padding: 10px;
            text-align: left;
            overflow: hidden;
        }

        .typeTitle {
            text-align: left;
            font-size: 14px;
            font-weight: bold;
            line-height: 24px;
            margin-left: 12px;
            margin-top: 10px;
        }

        .listBox .item {
            width: 32%;
            text-align: center;
            line-height: 30px;
            height: 30px;
            cursor: pointer;
            border: 1px solid #ddd;
            padding: 0;
            /* margin-right: 3px; */
            /* margin-bottom: 3px; */
            float: left;
            margin-right: 2px;
            font-size: 12px;
            margin-bottom: 2px;
        }

        .listBox .item:nth-child(3n) {
            margin-right: 0;
        }

        .listBox .active {
            background-color: #2a8cec;
            color: white;
        }

        .noData {
            text-align: center;
            color: #aaa;
        }

        .selectBox {
            height: 80vh;
            overflow-y: auto;
        }

        .tab {
            background: #fff;
            border-bottom: 1px solid #cbcbcd;
            line-height: 45px;
        }

        .tab span {
            padding-left: 4px;
            font-size: 14px;
        }

        .tabContent {
            display: flex;
            height: 45px;
            line-height: 45px;
            background: #2a8cec;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
        }

        .tabContentLeft {
            width: 25px;
        }

        .tabContentRight {
            width: 20px;
        }

        .tabContentMiddle {
            background: #2a8cec;
            flex: 1;
            overflow: hidden;
        }

        .tabActive {
            font-size: 14px;
            text-align: center;
            color: #2a8cec;
            background-image: url(/dist/img/tabApp.png);
            /* margin-left: 8px; */
            /* margin-right: 8px; */
            background-size: 100% 100%;
            /* padding: 10px 15px 15px; */
            float: left;
            height: 38px;
            line-height: 38px;
            margin-top: 9px;
            width: 50%;
        }

        .tabNo {
            text-align: center;
            font-size: 14px;
            color: #fff;
            /* margin-left: 8px; */
            /* margin-right: 8px; */
            background-size: 100% 100%;
            /* padding: 10px 15px 15px; */
            float: left;
            height: 38px;
            line-height: 38px;
            margin-top: 9px;
            width: 50%;
        }

        .selecetInput {
            width: 100%;
            line-height: 24px;
            padding: 0 5px;
        }

        .inputBox {
            position: relative;
        }

        .search-button {
            position: absolute;
            top: 6px;
            right: 10px;
            width: 14px;
            height: 14px;
            background-image: url(/dist/img/glass.jpg);
            border: 0 none;
            cursor: pointer;
            margin-top: 0px;
        }
    </style>
</head>
<body>
<section class="content" id="app" style="padding: 0px;padding-bottom: 50px;" v-cloak>
    <div class="div-td-content-more"><i></i></div>

    <div class="treeBox">
        <!--<div class="tabContent">-->
        <!--<div class="tabContentLeft"></div>-->
        <!--<div class="tabContentMiddle">-->

        <!--<span id="cusBtn" :class="selectIndex==0? 'tabActive':'tabNo'" @click="selectIndex=0;changeTree()">-->
        <!--按组织结构选择-->
        <!--</span>-->
        <!--<span :class="selectIndex==1? 'tabActive':'tabNo'" @click="selectIndex=1;">-->
        <!--按部门岗位选择-->
        <!--</span>-->
        <!--</div>-->
        <!--<div class="tabContentRight"></div>-->
        <!--</div>-->
        <div style="overflow: auto;background: #f7f8fa;margin: 10px 20px;border: 1px solid #ddd;">
            <!--  <input type="text" placeholder="人员姓名" class="form-control pull-left input-sm"
                     style="width: 100%;float: left !important;" v-model="searchParams.userName"
                     id="txtCoster"
                     v-show="selectIndex==0">-->
            <!--<div class="inputBox" v-show="selectIndex==0">-->
                <!--<input type="text" class="selecetInput" placeholder="输入姓名" id="autoUser" v-on:input="get_search()">-->
                <!--<input type="button" class="search-button">-->
            <!--</div>-->
            <ul class="ztree" id="ulRegion" style="height: 80vh;overflow-y: auto;" v-show="selectIndex==0"></ul>
            <!--<div class="selectBox" v-show="selectIndex==1">-->
            <!--<div class="typeTitle">请选择公司：</div>-->
            <!--<div class="companyLIst listBox">-->
            <!--<div :class="item.select?'item active':'item'" v-for="(item,i) in selectBox.companyList"-->
            <!--@click="selectItem(item,'1')">{{item.name}}-->
            <!--</div>-->
            <!--</div>-->
            <!--<div class="typeTitle">请选择部门：</div>-->

            <!--<div class="companyLIst listBox">-->
            <!--<div :class="item.select?'item active':'item'" v-for="(item,i) in selectBox.departList"-->
            <!--@click="selectItem(item,'2')">{{item.departName}}-->
            <!--</div>-->
            <!--<div class="noData" v-if="selectBox.departList.length==0">请先选择公司</div>-->
            <!--</div>-->
            <!--<div class="typeTitle">请选择职位：</div>-->
            <!--<div class="companyLIst listBox">-->
            <!--<div :class="item.select?'item active':'item'" v-for="(item,i) in selectBox.roleList"-->
            <!--@click="selectItem(item,'3')">{{item.roleName}}-->
            <!--</div>-->
            <!--<div class="noData" v-if="selectBox.roleList.length==0">请先选择部门</div>-->
            <!--</div>-->
            <!--</div>-->

        </div>

        <!--
                //<div class="tijiaoBtn" @click="save">确定</div>
        -->
        <input type="button" value="确定" @click="save"
               class="btn oaBtn btn-sm"
               style=" ">
    </div>


</section>

<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="/dist/plugins/scroll/myScroll.js"></script>
<!--框架已定义 JS-->
<!--oa自定义  JS-->
<script src="/dist/js/oaApp.js"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.exhide-3.5.js"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne,.lineTwo", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script>
    $.ajaxSetup({
        global: true,
        type: "POST",
        cache: false,
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        beforeSend: function () {
        },
        complete: function () {

        },
        error: function (e) {
            alert('error' + e.responseText);
        }
    });
    $.extend($.wyui, {
        page: {
            urlParams: null,
            queryParams: {
                requestPage: 1,
                pageSize: 30
            },
            dataUrl: '',
            createQueryParams: function () {
            },
            getByPage: function (type) {
                $.ajax({
                    url: $.wyui.page.dataUrl,
                    data: JSON.stringify($.wyui.page.queryParams),
                    beforeSend: function () {

                    },
                    complete: function () {
                    },
                    success: function (r) {
                        $.wyui.page.queryParams.requestPage++;

                        if (r.data.sendData.pager && r.data.sendData.pager.pageCount == 0) {
                            r.data.sendData.pager.pageCount = 1;
                        }
                        if (type == "scroll") {
                            $.wyui.page.getByPage_scroll_callback(r.data.sendData.records);
                        } else {
                            if ($.wyui.page.getByPage_callback_new) {
                                $.wyui.page.getByPage_callback_new(r.data.sendData.records);
                            }
                        }

                    }
                });
            }
        },
        postMethod: function (url, data, callback, sync, id) {
            if (!id) {
                id = "#app"
            }
            $.ajax({
                url: server.ip + url,
                async: sync ? false : true,
                data: JSON.stringify(data),
                beforeSend: function () {

                },
                complete: function () {
                    setTimeout(function () {
                    }, 1000);

                },
                success: function (r) {
                    if (!r.e.code) {
                        callback(r.data.sendData);
                    } else {
                        alert(r.e.desc);
                    }
                },
                error: function (e) {
                    alert(url + e.responseText);
                }
            });
        },
    });
</script>

<script type="text/javascript">
    $(function () {
        var zTreeRegion_setting = {
            view: {
                showIcon: function (treeId, treeNode) {
                    return treeNode.isParent;
                }
            },
            data: {
                simpleData: {
                    enable: true
                }
            },
            check: {
                chkboxType: {"Y": "ps", "N": "ps"},
                enable: true
            },
            callback: {
                onCheck: zTreeOnCheck,
                beforeClick: zTreeBeforeClick
            }
        };
        $.ajax({
            async: false,
            url: server.ip + "/system/getCDUAll.json",
            data: JSON.stringify({}),
            success: function (r) {
                var nodes = r.data.sendData;
                for (var i = 0; i < nodes.length; i++) {
                    if (nodes[i].name == "收件箱") {
                        nodes[i].name = "组织机构";
                    }
                }
                app.treeObj = $.fn.zTree.init($("#ulRegion"), zTreeRegion_setting, nodes);
            }
        });

        function zTreeBeforeClick(treeId, treeNode, clickFlag) {
            app.treeObj.checkNode(treeNode, '', true);
            return false;
        }

        function zTreeOnCheck(treeId, treeNode) {
            console.log(treeNode);
            var receivers = new Array();
            app.meetPerson = []
            var Nodes = app.treeObj.getCheckedNodes(true);
            for (var i = 0; i < Nodes.length; i++) {
                if (Nodes[i].type == "user") {
                    receivers.push(Nodes[i].name + "; ");
                    var data = {
                        copierId: Nodes[i].id,
                        copierName: Nodes[i].name
                    }
                    app.meetPerson.push(data)
                }
            }
            console.log(app.meetPerson);

            // $(".userBox").html(receivers)
        };
    });
</script>
<script type="text/javascript">
    var api = frameElement.api, W = api.opener;
    var query = null;
    var app = new Vue({
        el: '#app',
        data: {
            type:getUrlParamObj().flag,
            selectIndex: 0,
            selectBox: {
                companyList: [],
                departList: [],
                roleList: [],
                selectCompany: [],
                companyNames: [],
                departNames: [],
                roleNames: [],
                companyIds: [],
                userIds: []
            },
            meetPerson: [],
            mainId: getUrlParamObj().mainId,
            treeObj: "",
            userId: getUrlParamObj().userId,
            date: "",
            userIds: '',
            isGo: true
        },
        methods: {
            get_search: function () {
                clearTimeout(query);
                query = setTimeout(function () {
                    searchTree()
                }, 1000);
            },
            changeTree: function () {
                var that = this;
                if (that.userIds.length > 0) {
                    var userIdsStr = that.userIds
                    console.log(userIdsStr)
                    that.treeObj.getNodesByFilter(function (node) {
                        if (userIdsStr.indexOf(node.id) > -1) {
                            that.treeObj.checkNode(node, true, true, false);
                        } else {
                            that.treeObj.checkNode(node, false, false, false);
                        }
                    });
                }

            },
            saveUser: function () {
//                $(".selecetInput").val('');
//                searchTree()
                var receivers = new Array();
                this.meetPerson = []
                var Nodes = this.treeObj.getCheckedNodes(true);

                for (var i = 0; i < Nodes.length; i++) {
                    if (Nodes[i].type == "user") {
                        receivers.push(Nodes[i].id);
                        var data = {
                            copierId: Nodes[i].id,
                            copierName: Nodes[i].name,
                            moudleType: 'tempMeet',
                            mainId: ''
                        }
                        this.meetPerson.push(data)
                    }
                }
            },
            save: function () {
                var _this = this;
                _this.saveUser();
                console.log(_this.meetPerson)
                var data = {}
                data.mainId = _this.mainId;
                data.meetPerson = _this.meetPerson
                data.type = _this.type
                console.log(data)
                $.wyui.postMethod(urlConfig.meet.meet.saveMeetPerson, data, function (r) {
                    if (r.id) {
                        top.refreshTabByName("会议纪要", "no");
                        top.closeTabByPageId("hyxq");
                        //top.refreshTabById("xzpx");
                        setTimeout(function () {
                            var title = '会议详情';
                            top.addTabs({
                                id: 'hyxq',
                                title: title,
                                close: true,
                                url:'meet/detail.html?pageType=edit&id='+data.mainId
                            });
                            api.close();
                        }, 300)

                    }
                });
            },


        },
        mounted: function () {
            var _this = this; //声明一个变量指向Vue实例this，保证作用域一致
            mainId = getUrlParamObj().mainId;
            _this.mainId = mainId;
            console.log(_this.mainId)
            $.wyui.postMethod(urlConfig.meet.meet.getMeetPersonByMeetId, {
                id: mainId,
                type:_this.type
            }, function (r) {
                console.log(r);
                var userIds = "";
                if (r.person) {
                    for (var i = 0; i < r.person.length; i++) {
                        userIds = userIds + r.person[i].copierId + ','
                    }
                    _this.userIds = userIds
                    console.log()
                }
                _this.changeTree();

            });
            //页面初次加载  执行客户分页列表
        }
    });

</script>
<script>
    //接收其他页面传递的参数
    function onParamReceived(param) {
        app.userIds = param;
    }
</script>
<script>

    $(".search-button").on('click', function () {
        searchTree()
    });

    function searchTree() {
        var text = $(".selecetInput").val();

        if (text != "") {
            var allNode = app.treeObj.transformToArray(app.treeObj.getNodes());
            ;
            app.treeObj.hideNodes(allNode);
            nodeList = app.treeObj.getNodesByParamFuzzy("name", text);
            nodeList = app.treeObj.transformToArray(nodeList);
            for (var n in nodeList) {
                app.treeObj.selectNode(nodeList[n], true);
                findParent(app.treeObj, nodeList[n]);
            }
            app.treeObj.showNodes(nodeList);

        } else {
            var allNode = app.treeObj.transformToArray(app.treeObj.getNodes());
            ;
            app.treeObj.showNodes(allNode);
            app.treeObj.cancelSelectedNode();
            app.treeObj.expandAll(false);
            for (var index in allNode) {
                if (allNode[index].level < 2) {
                    app.treeObj.expandNode(allNode[index], true, false, false);
                }
            }

        }
    }

    function findParent(treeObj, node) {
        treeObj.expandNode(node, true, false, false);
        var pNode = node.getParentNode();
        if (pNode != null) {
            nodeList.push(pNode);
            findParent(treeObj, pNode);
        }
    }
</script>

</body>